package com.sky.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("documents")
public class Document implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id; // 文档ID

    private String title; // 文档标题

    @TableField("file_name")
    private String fileName; // 文件名

    @TableField("file_path")
    private String filePath; // 文件存储路径

    @TableField("file_size")
    private Long fileSize; // 文件大小(字节)

    @TableField("file_type")
    private String fileType; // 文件类型

    private String category; // 文档分类

    @TableField("upload_by")
    private Integer uploadBy; // 上传人ID

    @TableField("upload_time")
    private LocalDateTime uploadTime; // 上传时间

    @TableField("download_count")
    private Integer downloadCount; // 下载次数

    @TableField(exist = false)
    private Integer printCount; // 打印次数（非数据库字段）

    private String isPublic; // String类型，支持'private'/'pending_review'/'public'

    private String status; // 文档状态：active/inactive

    @TableField(exist = false)
    private String uploaderName; // 上传者姓名

    @TableField(exist = false)
    private String uploaderType; // 上传者类型
}